ATSUGetRunStyle

Finds the style run information at a given location and the range of text that shares this information.

OSStatus ATSUGetRunStyle (
                     ATSUTextLayout iTextLayout,
                     UniCharArrayOffset iOffset,
                     ATSUStyle *oStyle,
                     UniCharArrayOffset *oRunStart,
                     UniCharCount *oRunLength);
iTextLayout
A reference of type ATSUTextLayout. Pass a reference to an initialized text layout object. You cannot pass NULL for this parameter.

iOffset
A value of type UniCharArrayOffset. Pass the edge offset of the location whose style run information and the range of text sharing that information you want to find. To indicate the beginning of the text buffer, pass the constant kATSUFromTextBeginning, described in Text Offset Constant. If you pass an edge offset that is outside the text buffer, ATSUGetRunStyle returns the result code kATSUInvalidTextRangeErr.

oStyle
A pointer to a reference of type ATSUStyle. On return, the style run information of the location in iOffset that is shared by the range of text from oRunStart to oRunLength. If the location you passed in iOffset is at a style run boundary, ATSUGetRunStyle passes back the style run information of the next style run in this parameter.

oRunStart
A pointer to a value of type UniCharArrayOffset. On return, the edge offset of the beginning of the style run that includes the location specified in iOffset.

oRunLength
A pointer to a value of type UniCharCount. On return, the length of the text sharing the same style run attributes, font features, and font variations.

function result
A result code. See Result Codes.
DISCUSSION
The ATSUGetRunStyle function finds the style run information at a given location and the range of text that shares this information (including style run attributes, font features, and font variations).

If there is only one style run set in the text layout object (whether or not it covers the entire range of text in the text layout object), ATSUGetRunStyle passes back the style run information at the specified offset and uses it to set the style run information of the remaining text.

If you want to find the style run information that is continuous over a range of text, call the function ATSUGetContinuousAttributes.

VERSION NOTES
Available beginning with ATSUI 1.0.


© 2000 Apple Computer, Inc. – (Last Updated 25 Jan 00)